<%@ page import="com.ydgk.bean.Book" %>
<%@ page import="com.ydgk.dao.SupplierDao" %>
<%@ page import="com.ydgk.bean.Supplier" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: zzz
  Date: 2019/10/5
  Time: 18:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>bookinformation</title>
    <link rel="stylesheet" type="text/css" href="css/bookinformation.css">
    <script language="javascript" type="text/javascript" src="My97DatePicker/WdatePicker.js"></script>
</head>
<body>
<%
    Book book = (Book)request.getAttribute("book");
    String pageNumber = (String)request.getAttribute("pageNumber");
    SupplierDao supplierDao = new SupplierDao();
    List<Supplier> list = supplierDao.findAll();
%>
<div>
<form action="BookUpdateByIdServlet.action?" method="get">

    <input type="hidden" name="bid" value="<%= book.getBid()%>">
    <input type="hidden" name="pageNumber" value="<%= pageNumber%>">
    <p>图书名字</p>
    <input type="text" name="bname" value="<%= book.getBname()%>">
    <p>图书作者</p>
    <input type="text" name="bauthor" value="<%= book.getBauthor()%>">
    <p>单本价格</p>
    <input type="text" name="bprice"  value="<%= book.getBprice()%>">
    <p>出版日期</p>
    <input type="text" name="bdate" onclick="WdatePicker()" value="<%= book.getBdate()%>">
    <p>出版社名字</p>
    <select name="sid" id="sid">
        <%for(int i =0;i<list.size();i++){%>
        <option value="<%= list.get(i).getSid()%>">
            <%= list.get(i).getSname()%>
        </option>
        <%}%>
    </select>
    <br><br>
    <input id="button" type="submit" value="修改">
</form>
</div>
</body>
<script src="js/jquery-2.1.1.min.js" type="text/javascript"></script>

<script>
    $(function () {
        $("select").val("<%= book.getSid()%>");
        $("select").css({width:"250px",
            "font-size": "18px",
             color: "#53e3a6",
            "text-align": "center",
             display: "block" ,
             border: "1px solid rgba(255, 255, 255, 0.4)" ,
            "background-color": "rgba(255, 255, 255, 0.2)" ,
            "border-radius": "3px" ,
             padding: "10px 15px" ,
             margin: "0 auto 10px auto",
            "font-family": "方正喵呜体"
             });
        $("option").css("color","darkmagenta");
    });
</script>
</html>
